<script setup lang="ts">
type MenuTreeItem = Vm.Func & { children?: MenuTreeItem[] };
interface PropType {
    list: MenuTreeItem[]
}
defineProps<PropType>();
</script>

<template>
    <template v-for="item in list">
        <!-- 非叶子节点 -->
        <el-sub-menu v-if="item.func_key === ''" :index="item.func_id.toString()">
            <template #title>
                <el-icon>
                    <Setting />
                </el-icon>
                <span v-text="item.func_name"></span>
            </template>
            <EduMenu v-if="item.children" :list="item.children" />
        </el-sub-menu>
        <!-- 叶子节点（功能节点） -->
        <el-menu-item v-else :index="item.func_key">
            <el-icon>
                <Menu />
            </el-icon>
            <span v-text="item.func_name"></span>
        </el-menu-item>
    </template>
</template>

<style scoped>
</style>
